package main

import (
	"log"
	"net/http"

	"go_print_bridge/api"
)

func main() {
	http.HandleFunc("/api/printers", api.PrintersHandler)
	http.HandleFunc("/api/printers/", api.PrinterOptionsHandler)
	http.HandleFunc("/api/print", api.PrintHandler)
	http.HandleFunc("/api/print/status", api.PrintStatusHandler)

	// 静态文件服务
	http.Handle("/", http.FileServer(http.Dir("./web")))

	log.Println("服务启动于 http://localhost:8080 ...")
	if err := http.ListenAndServe(":8080", nil); err != nil {
		log.Fatal(err)
	}
}
